<?php
namespace Tools\Controller;
use Common\Controller\HomebaseController;

/**
 * 合作伙伴
 */
class  PartnerController extends HomebaseController {


	public function index(){
		$db_prefix=C('DB_PREFIX');
		$lists = D('ToolsPartner')
				->alias('a')
				->field('a.*,b.cate_name')
				->join($db_prefix.'tools_partner_cate as b on a.partner_cid = b.cate_id')
				->select();

		//根据相同的键值进行合并
		$result= array();
		foreach ($lists as $key => $list) {
			$result[$list['cate_name']][] = $list;
		}
		
		//赋值
		$this->assign('result', $result);
		$this->display("index");
	}

}
